<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class SupplyResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
       if(empty($this->resource)) return [];

       return [
        'id'=>$this->id,
        'company'=>$this->company,
        'username'=>$this->username,
        'address'=>$this->address,
        'email'=>$this->email,
        'account'=>$this->account,
        'phone'=>$this->phone,
        'created_at'=>$this->created_at,
        'status'=>$this->status,
        'reason'=>$this->reason,
       ];

    }
}
